<template>
    <rx-dialog @handOk="handOk" @cancel="cancel">
        <rx-layout>
            <div slot="center" style>
                <rx-grid
                    ref="table"
                    :allowRowSelect="true"
                    :multiSelect="false"
                    :columns="columns"
                    :defaultPageSize="10"
                    url="/api-system/system/core/sysJenkins/query"
                    :queryParam="queryParam"
                    data-field="result.data"
                    :pageSizeOptions="['10','30','40']"
                    id-field="id"
                    @selectChange="onSelectChange"
                >
                </rx-grid>
            </div>
        </rx-layout>
    </rx-dialog>
</template>

<script>
import {BaseList, RxLayout, Util} from '@lowcode/jpaas-common-lib'

export default {
    name: "SysJenkinsDialog",
    mixins: [BaseList],
    components: {
        RxLayout
    },
    props: {
        layerid: {
            type: String,
            default: ""
        },
        destroy: {
            type: Function
        }
    },
    data() {
        return {
            columns: [
                {
                    title: this.$ti18('rxList.index','序号'),
                    type: 'indexColumn',
                    width: 40,
                    dataIndex: 'serial',
                    scopedSlots: {customRender: 'serial'}
                },
                {title: '备注名', dataIndex: 'name', width: 100},
                {title: 'JenkinsURL', dataIndex: 'url', width: 200},
                {title: '创建人', dataIndex: 'createByName', width: 100},
                {title: '创建时间', dataIndex: 'createTime', width: 100}
            ],
        }

    },
    created() {
        this.queryParam.Q_TYPE__S_EQ=this.catKey;
    },
    methods: {
        handOk(vm) {
            var rows = this.selectedRows;
            if (rows.length == 0) {
                this.$message.warning(this.$ti18("rxMsa.masWarn.selectOneRecord","请选择一行记录!"));
                vm.loading=false;
                return;
            }
            Util.closeWindow(this, "ok", rows[0]);
        },
        cancel() {
            Util.closeWindow(this, "cancel");
        },
    },
    watch: {}
}
</script>

<style scoped>

</style>